﻿<controls:ChildWindow x:Class="LEEAAttendanceControl.Views.NewPunch"
           xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
           xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="500" Height="180" 
           Title="New Punch">
    <Grid x:Name="LayoutRoot" Margin="2" DataContext="{Binding}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <Grid Grid.Row="0" HorizontalAlignment="Center">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="55"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="45"/>
                <ColumnDefinition Width="55"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            
            <sdk:Label Content="Type:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" Margin="3"
                       VerticalAlignment="Center"/>
            <ComboBox x:Name="TypeCombo" Grid.Column="1" Grid.Row="0" Width="145" Margin="3" Height="25"
                      DisplayMemberPath="Name" SelectedValuePath="Name"
                      SelectedValue="{Binding PunchType, Mode=TwoWay, NotifyOnValidationError=True
                                      , ValidatesOnExceptions=True, ValidatesOnDataErrors=True}"/>

            <sdk:Label Content="Day:" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" Margin="3,25,3,3"
                       VerticalAlignment="Center"/>
            <sdk:DatePicker x:Name="PunchDay" Grid.Column="1" Grid.Row="1" Width="145" Margin="3,25,3,3"
                            SelectedDate="{Binding DataTime, Mode=TwoWay, NotifyOnValidationError=True
                            , ValidatesOnExceptions=True, ValidatesOnDataErrors=True}"/>

            <sdk:Label Content="Time:" Grid.Column="3" Grid.Row="1" HorizontalAlignment="Left" Margin="3,25,3,3"
                       VerticalAlignment="Center"/>
            <toolkit:TimePicker x:Name="PunchTime" Grid.Column="4" Grid.Row="1" Width="145" Margin="3,25,3,3"
                                Value="{Binding DataTime, Mode=TwoWay, NotifyOnValidationError=True
                                , ValidatesOnExceptions=True, ValidatesOnDataErrors=True}"/>
        </Grid>
        
        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,20,10,0">
            <Button x:Name="SaveButton" Content="Save" Width="75" Height="23" Margin="0,0,15,0" Click="SaveButton_Click"/>
            <Button x:Name="CancelButton" Content="Cancel" Width="75" Height="23" Click="CancelButton_Click"/>
        </StackPanel>
    </Grid>
</controls:ChildWindow>